import {inject, observer} from "mobx-react";
import {toJS} from 'mobx';

@inject("demoTestStore")
@observer
class Demo extends React.Component {
  constructor(props) {
    super(props);
  }
  componentDidMount() {
    this.props.demoTestStore.getBaseInfo();
  }
  render() {
    let test = this.props.demoTestStore.test;
    // let {test} = this.props.demoTestStore;
    test = toJS(test);
    // let obj = {a: 1, b:2};
    // let objTest = {...obj};
    // let objTest2 = {...obj, b:3};
    return (
      <div className="wea-demo" onClick={this.onClick}>
        {test.content}
      </div>
    );
  }
  
  onClick = () => {
    alert(1);
  }
}

export default Demo;